<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/3/15
 * Time: 19:47
 */

namespace Admin\Controller;
use Think\Controller;

class BaseController extends Controller
{
    public function __construct()
    {
        parent::__construct();//dump(session());exit;
        if(!session('id'))
            $this->error('必须先登录!',U('Login/login'));

        if (CONTROLLER_NAME == 'Index')
            return FALSE;
        $priModel= D('privilege');
        if (!$priModel->chkpri())
            $this->error('无权访问!');
    }
}